home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 28
/
Creative-Review-CD-ROM-28.iso
/
pc
/
kungfu
/
assets
/
game.dir
/
00015_Script_sting class
< prev
next >
Wrap
Text File
|
1997-08-08
|
5KB
|
208 lines
-- sting class
-- --------------------------------------------------
property list
property videooffset
property currentstingname
property currentorder
property currentback
property clipindex
property currentclip
-- ==================================================
global gcallback, ggame
-- ==================================================
-- new method
-- --------------------------------------------------
on new me, props
minit me, props
return me
end mnew
-- ==================================================
-- minit method
-- --------------------------------------------------
on minit me, props
-- put "in minit sting manager"
set videochannel = 48
set data = data2list ( "sting data" )
set videooffset = data2list ( "sting offset data" )
set list = [:]
repeat with stingindex = 1 to count ( data )
set thisstingdata = getat ( data, stingindex )
set stingname = getpropat ( data, stingindex )
-- put "ò sting: ", stingname
set stinglist = [:]
addprop list, stingname, stinglist
set cast = getaprop ( thisstingdata, #cast )
setaprop stinglist , #cast, cast
set videodata = getaprop ( thisstingdata, #video )
set videoorder = []
repeat with clipindex = 1 to count ( videodata )
set clipprops = getat ( videodata, clipindex )
set loc = getaprop ( clipprops, #loc )
set loc = loc + videooffset
setaprop clipprops, #loc, loc
setaprop clipprops, #channel, videochannel
setaprop clipprops, #stay, false
setaprop clipprops, #castname, "sting.mov"
set videodraw = new ( script "draw class" , clipprops )
setaprop clipprops, #draw, videodraw
set clip = new ( script "video clip class" , clipprops )
add videoorder, clip
end repeat
setaprop stinglist , #video, videoorder
end repeat
set stingindex = 0
-- put "out minit sting manager"
end minit
-- ==================================================
-- mstart method
-- --------------------------------------------------
on mstart me, screenlist
-- put "in mstart sting manager"
repeat while msoundbusy ( gsound )
updatestage
end repeat
set data = getaprop ( screenlist , #data )
set currentstingname = getat ( data, 1 )
set currentsting = getaprop ( list, currentstingname )
set currentback = getaprop ( currentsting, #cast )
set currentorder = getaprop ( currentsting, #video )
set clipindex = 0
maddtask gtime, me, the timer + 60
-- put "out mstart sting manager"
end mstart me
-- ==================================================
-- mdotask method
-- --------------------------------------------------
on mdotask me
-- put "in mdotask sting manager"
mnextclip me
-- put "in mdotask sting manager"
end mdotask
-- ==================================================
-- mfinish method
-- --------------------------------------------------
on mfinish me
-- put "in mfinish sting manager"
msplat gback, currentback
mhide me
mfinishscreen ggame
-- put "out mfinish sting manager"
end mfinish me
-- ==================================================
-- mnextclip method
-- --------------------------------------------------
on mnextclip me
-- put "in mnextclip sting class :"
set clipindex = clipindex + 1
if clipindex > count ( currentorder ) then
mfinish ( me )
return
end if
set currentclip = getat ( currentorder, clipindex )
set gcallback = me
if clipindex = 1 then set checkhang = true
else set checkhang = false
mplay currentclip, checkhang
-- put "out mnextclip sting class :"
end mnextclip
-- ==================================================
-- mcallback method
-- --------------------------------------------------
on mcallback me
-- put "in mcallback sting manager"
mnextclip me
-- put "out mcallback sting manager"
end mcallback me
-- ==================================================
-- mhide method
-- --------------------------------------------------
on mhide me
put "in mhide sting manager"
mhide the draw of currentclip
put "out mhide sting manager"
end mhide me
-- ==================================================
-- mshow method
-- --------------------------------------------------
on mshow me
put "in mshow sting"
put "out mshow sting"
end mshow